<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>WLog: Record.cpp源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- 制作者 Doxygen 1.5.8 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="namespaces.html"><span>名字空间</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<h1>Record.cpp</h1><a href="Record_8cpp.html">浏览该文件的文档。</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdarg.h&gt;</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="preprocessor">#include "<a class="code" href="Record_8h.html">Record.h</a>"</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include "<a class="code" href="Common_8h.html">Common.h</a>"</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include "<a class="code" href="WLogInterface_8h.html">WLogInterface.h</a>"</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="keyword">namespace </span>WLog
<a name="l00008"></a>00008 {
<a name="l00009"></a><a class="code" href="classWLog_1_1Record.html#8cdedc2515abc492b5c4e70fa9543350">00009</a>     <a class="code" href="classWLog_1_1Record.html#8cdedc2515abc492b5c4e70fa9543350">Record::Record</a>(<span class="keywordtype">int</span> nLevel, <span class="keywordtype">int</span> nLine, <span class="keywordtype">string</span> strFuncName, <span class="keywordtype">string</span> strFileName)
<a name="l00010"></a>00010     {
<a name="l00011"></a>00011         this-&gt;<a class="code" href="classWLog_1_1Record.html#1d571076a4074b5654c17e008f203fc5">m_nLevel</a> = nLevel;
<a name="l00012"></a>00012         this-&gt;<a class="code" href="classWLog_1_1Record.html#7799d7fa2aaddb66821bf5abad26938e">m_nLine</a> = nLine;
<a name="l00013"></a>00013         this-&gt;<a class="code" href="classWLog_1_1Record.html#0d907faeee2f24237aa9991b4e0a7d00">m_strTime</a> = <a class="code" href="namespaceWLog.html#1c4f5dd9ea3aeb7f92f7e540197a00b8">getTimeStr</a>(<a class="code" href="namespaceWLog.html#bde42e02b00d5bd21cba645298573f19">now_time_t</a>());
<a name="l00014"></a>00014         this-&gt;<a class="code" href="classWLog_1_1Record.html#d6768f917f2ea19f11e5c0177cb725a6">m_strFuncName</a> = strFuncName;
<a name="l00015"></a>00015         this-&gt;<a class="code" href="classWLog_1_1Record.html#d82ac9e750430e01f1895186a8cc70bf">m_strFileName</a> = strFileName;
<a name="l00016"></a>00016     }
<a name="l00017"></a>00017 
<a name="l00018"></a><a class="code" href="classWLog_1_1Record.html#0cc924c9b4be6d6e191d2519b23f7e6c">00018</a>     <a class="code" href="classWLog_1_1Record.html#0cc924c9b4be6d6e191d2519b23f7e6c">Record::~Record</a>()
<a name="l00019"></a>00019     {
<a name="l00020"></a>00020 
<a name="l00021"></a>00021     }
<a name="l00022"></a>00022 
<a name="l00023"></a><a class="code" href="classWLog_1_1Record.html#45eda77f0ccfd66d429c1cf9d448a948">00023</a>     <span class="keywordtype">void</span> <a class="code" href="classWLog_1_1Record.html#45eda77f0ccfd66d429c1cf9d448a948">Record::operator () </a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* format, ...)
<a name="l00024"></a>00024     {       
<a name="l00025"></a>00025         <span class="keywordflow">if</span> (<a class="code" href="namespaceWLog.html#88d869c121c4e8992922002033ac06c6" title="获取log指针.">getLog</a>()-&gt;getOutLevel() &lt;= this-&gt;<a class="code" href="classWLog_1_1Record.html#1d571076a4074b5654c17e008f203fc5">m_nLevel</a>)
<a name="l00026"></a>00026         { 
<a name="l00027"></a>00027             va_list arglist;
<a name="l00028"></a>00028             va_start(arglist, format );
<a name="l00029"></a>00029             this-&gt;<a class="code" href="classWLog_1_1Record.html#ba5c5b6680a63585eca4644c66e4680b">m_strMsg</a> = <a class="code" href="namespaceWLog.html#c39b3d60384769edcbbb814afb1818ce">vstringFormat</a>(format, arglist);
<a name="l00030"></a>00030             <a class="code" href="namespaceWLog.html#88d869c121c4e8992922002033ac06c6" title="获取log指针.">getLog</a>()-&gt;<a class="code" href="classWLog_1_1ILogProcess.html#81da7a7de8f4eece0f19a1f3fe3becbf" title="添加一条记录">pushRecord</a>(*<span class="keyword">this</span>);
<a name="l00031"></a>00031             va_end( arglist );
<a name="l00032"></a>00032         }
<a name="l00033"></a>00033     }
<a name="l00034"></a>00034 }
</pre></div></div>
<hr>
<address style="align: right;">
  Generated on Mon Apr 6 21:08:12 2009 for WLog by 韦体东<img src="logo.png" align="middle"/></address>
</body>
</html>
